﻿CREATE TABLE [dbo].[Loan] (
    [id]              INT             IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [Summary]         NVARCHAR (100)  CONSTRAINT [DF_Loan_Summary] DEFAULT ('') NULL,
    [CompanyId]       INT             CONSTRAINT [DF_Loan_CompanyId] DEFAULT ((0)) NULL,
    [CompanyName]     NVARCHAR (100)  CONSTRAINT [DF_Loan_CompanyName] DEFAULT ('') NULL,
    [DepartmentId]    INT             CONSTRAINT [DF_Loan_DepartmentId] DEFAULT ((0)) NULL,
    [DepartmentName]  NVARCHAR (100)  CONSTRAINT [DF_Loan_DepartmentName] DEFAULT ('') NULL,
    [ENameId]         VARCHAR (10)    CONSTRAINT [DF_Loan_ENameId] DEFAULT ((0)) NULL,
    [EName]           NVARCHAR (10)   CONSTRAINT [DF_Loan_EName] DEFAULT ('') NULL,
    [PostCategoryId]  INT             CONSTRAINT [DF_Table_1_PostCategory] DEFAULT ((0)) NULL,
    [PostCategory]    NVARCHAR (50)   CONSTRAINT [DF_Loan_PostCategory] DEFAULT ('') NULL,
    [Address]         NVARCHAR (500)  CONSTRAINT [DF_Loan_Address] DEFAULT ('') NULL,
    [Days]            NVARCHAR (50)   CONSTRAINT [DF_Loan_Days] DEFAULT ('') NULL,
    [Money]           DECIMAL (18, 2) CONSTRAINT [DF_Loan_Money] DEFAULT ((0)) NULL,
    [Cause]           NVARCHAR (MAX)  CONSTRAINT [DF_Loan_Cause] DEFAULT ('') NULL,
    [PZPerson]        VARCHAR (10)    CONSTRAINT [DF_Loan_PZPerson] DEFAULT ('') NULL,
    [PZPersonName]    NVARCHAR (10)   CONSTRAINT [DF_Loan_PZPersonName] DEFAULT ('') NULL,
    [SHPerson]        VARCHAR (10)    CONSTRAINT [DF_Loan_SHPerson] DEFAULT ('') NULL,
    [SHPersonName]    NVARCHAR (10)   CONSTRAINT [DF_Loan_SHPersonName] DEFAULT ('') NULL,
    [lrrq]            DATETIME        CONSTRAINT [DF_Loan_lrrq] DEFAULT (getdate()) NULL,
    [userid]          VARCHAR (10)    CONSTRAINT [DF_Loan_userid] DEFAULT ('') NULL,
    [username]        NVARCHAR (10)   CONSTRAINT [DF_Loan_username] DEFAULT ('') NULL,
    [flag]            INT             CONSTRAINT [DF_Loan_flag] DEFAULT ((0)) NULL,
    [PaymentTypeId]   INT             CONSTRAINT [DF_Loan_PaymentTypeId_1] DEFAULT ((0)) NULL,
    [PaymentTypeName] NVARCHAR (50)   CONSTRAINT [DF_Loan_PaymentTypeName_1] DEFAULT ('') NULL,
    [BankId]          INT             CONSTRAINT [DF_Loan_BankId_1] DEFAULT ((0)) NULL,
    [BankName]        NVARCHAR (50)   CONSTRAINT [DF_Loan_BankName_1] DEFAULT ('') NULL,
    [HKDate]          DATETIME        NULL,
    [typeid]          INT             CONSTRAINT [DF_Loan_typeid] DEFAULT ((0)) NULL,
    CONSTRAINT [PK_Loan] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'摘要', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'Summary';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款单位ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'CompanyId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款单位名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'CompanyName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款部门ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'DepartmentId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款部门名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'DepartmentName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款人编号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'ENameId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款人姓名', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'EName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'级别ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'PostCategoryId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'级别名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'PostCategory';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'出差地点', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'Address';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'天数', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'Days';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'Money';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'借款事由', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'Cause';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'批准人编号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'PZPerson';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'批准人姓名', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'PZPersonName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'财务审核人编号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'SHPerson';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'财务审核人姓名', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'SHPersonName';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'录入日期', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'lrrq';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'录入人编号（经办人）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'userid';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'录入人姓名（经办人）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'username';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否归还借条（0：未归还，1：已归还）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'还款日期', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'HKDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'类型，0：借款，1：押金', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Loan', @level2type = N'COLUMN', @level2name = N'typeid';

